package org.zhadoop.stream.cql.semanticanalyzer.parser.visitor;

import org.antlr.v4.runtime.misc.NotNull;
import org.zhadoop.stream.cql.semanticanalyzer.parser.CQLParser.CombineConditionContext;
import org.zhadoop.stream.cql.semanticanalyzer.parser.CQLParser.JoinSourceContext;
import org.zhadoop.stream.cql.semanticanalyzer.parser.context.FromClauseContext;

/**
 * from 子句表达式
 * 
 * @author zwd
 *
 */
public class FromClauseVisitor extends AbsCQLParserBaseVisitor<FromClauseContext> {

	private FromClauseContext context = null;

	public FromClauseVisitor() {
		context = new FromClauseContext();
	}

	@Override
	protected FromClauseContext defaultResult() {
		return context;
	}

	@Override
	public FromClauseContext visitJoinSource(@NotNull JoinSourceContext ctx) {
		JoinSourceVisitor visitor = new JoinSourceVisitor();
		context.setSourceContext(visitor.visit(ctx));
		return context;
	}
	
	@Override
	public FromClauseContext visitCombineCondition(@NotNull CombineConditionContext ctx) {
		CombineConditionVisitor visitor = new CombineConditionVisitor();
        context.setCombine(visitor.visit(ctx));
        return context;
	}

}
